#ifndef _HDR_MAIN_WINDOW
#define _HDR_MAIN_WINDOW

#include <windows.h>
#include <string>

#include "nehefont.h"
#include "texture.h"
#include "map.h"
#include "shader.h"
#include "character.h"

class main_window;

extern main_window* mwin;

#include "revision.h"

#ifdef HNR_DEBUG
    #define __COMPILEVER__ "debug"
#elif defined HNR_RELEASE
    #define __COMPILEVER__ "release"
#else
    #define __COMPILEVER__ ""
#endif

class main_window{
    protected:
        std::string     sClassName;
        std::string     sName;
        HINSTANCE       hInstance;
        HWND            hWnd;
        HGLRC           hRC;
        HDC             hDC;
        bool            bCreated;
        bool            bFullscreen;
        int             iBpp;
        DWORD           dwStyle;
        DWORD           dwExStyle;
        DWORD           dwFsStyle;
        DWORD           dwFsExStyle;
        RECT            rctCurSize;

        float           screenOffX,screenOffY;

        //freetype::font_data font;
        //texture*        herbe;
        //animated_texture* montre;
        //map*            mp;

        //motion_controller clk_normal,clk_backloop,clk_delayed,clk_quick,clk_slow;

    public:
        main_window();
        ~main_window();

        void create();
        void destroy();
        void reload();

        void initGL();
        void resizeGLScene(RECT);

        void display();
        bool setCurrent();
        void releaseContext();
        void swapBuffers();
        void drawGLScene();

        void actionExec();

        static LRESULT CALLBACK winDispatchMessage(HWND, UINT, WPARAM, LPARAM);

};

#endif

